<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Hexo建站 | 小李的博客</title><meta name="author" content="蛇皮小李"><meta name="copyright" content="蛇皮小李"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="简介Hexo是一个快速、简洁且高效的博客框架。Hexo使用 Markdown（或其他标记语言）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。 安装安装 Hexo 相当简单，只需要先安装下列应用程序即可：  Node.js (Node.js 版本需不低于 10.13，建议使用 Node.js 12.0 及以上版本) Git  在命令行中使用npm安装Hexo 1$ npm install -g">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo建站">
<meta property="og:url" content="https://lt-codehub.github.io.git/2023/12/23/Hexo%E5%BB%BA%E7%AB%99/index.html">
<meta property="og:site_name" content="小李的博客">
<meta property="og:description" content="简介Hexo是一个快速、简洁且高效的博客框架。Hexo使用 Markdown（或其他标记语言）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。 安装安装 Hexo 相当简单，只需要先安装下列应用程序即可：  Node.js (Node.js 版本需不低于 10.13，建议使用 Node.js 12.0 及以上版本) Git  在命令行中使用npm安装Hexo 1$ npm install -g">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2023-12-23T12:26:08.000Z">
<meta property="article:modified_time" content="2023-12-28T12:38:10.987Z">
<meta property="article:author" content="蛇皮小李">
<meta property="article:tag" content="博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://lt-codehub.github.io.git/2023/12/23/Hexo%E5%BB%BA%E7%AB%99/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Hexo建站',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-12-28 20:38:10'
}</script><script>(win=>{
      win.saveToLocal = {
        set: (key, value, ttl) => {
          if (ttl === 0) return
          const now = Date.now()
          const expiry = now + ttl * 86400000
          const item = {
            value,
            expiry
          }
          localStorage.setItem(key, JSON.stringify(item))
        },
      
        get: key => {
          const itemStr = localStorage.getItem(key)
      
          if (!itemStr) {
            return undefined
          }
          const item = JSON.parse(itemStr)
          const now = Date.now()
      
          if (now > item.expiry) {
            localStorage.removeItem(key)
            return undefined
          }
          return item.value
        }
      }
    
      win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        script.onerror = reject
        script.onload = script.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          script.onload = script.onreadystatechange = null
          resolve()
        }

        Object.keys(attr).forEach(key => {
          script.setAttribute(key, attr[key])
        })

        document.head.appendChild(script)
      })
    
      win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onerror = reject
        link.onload = link.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          link.onload = link.onreadystatechange = null
          resolve()
        }
        document.head.appendChild(link)
      })
    
      win.activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
        if (t === 'dark') activateDarkMode()
        else if (t === 'light') activateLightMode()
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
      const detectApple = () => {
        if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
          document.documentElement.classList.add('apple')
        }
      }
      detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="小李的博客"><span class="site-name">小李的博客</span></a></span><div id="menus"><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Hexo建站</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-12-23T12:26:08.000Z" title="发表于 2023-12-23 20:26:08">2023-12-23</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-12-28T12:38:10.987Z" title="更新于 2023-12-28 20:38:10">2023-12-28</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Hexo建站"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h1><p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">Hexo</a>是一个快速、简洁且高效的博客框架。Hexo使用 <a target="_blank" rel="noopener" href="http://daringfireball.net/projects/markdown/">Markdown</a>（或其他标记语言）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。</p>
<h1 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h1><p>安装 Hexo 相当简单，只需要先安装下列应用程序即可：</p>
<ul>
<li><a target="_blank" rel="noopener" href="http://nodejs.org/">Node.js</a> (Node.js 版本需不低于 10.13，建议使用 Node.js 12.0 及以上版本)</li>
<li><a target="_blank" rel="noopener" href="http://git-scm.com/">Git</a></li>
</ul>
<p>在命令行中使用npm安装Hexo</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">npm install -g hexo-cli</span></span><br></pre></td></tr></table></figure>

<p>安装完成后使用hexo命令测试是否安装成功</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo v <span class="comment">#查看hexo版本</span></span></span><br></pre></td></tr></table></figure>

<h1 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h1><p>使用命令行或者PowerShell执行</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo init &lt;文件夹&gt; <span class="comment">#创建&lt;文件夹&gt;并拉取项目文件</span></span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">cd</span> &lt;文件夹&gt;</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">npm install</span> </span><br><span class="line">或者</span><br><span class="line">在文件夹中直接使用</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo init</span></span><br></pre></td></tr></table></figure>

<p><strong>hexo初始化会使用git拉取其在github上的源项目</strong></p>
<p><img src="https://s2.loli.net/2023/12/23/yOEWoZB6QIxLc9F.png" alt="image-20231218193337408"></p>
<p>本地启动项目</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo s</span></span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2023/12/23/uJbXjqHhQSfrso5.png" alt="image-20231218193714584"></p>
<p>默认主页</p>
<p><img src="https://s2.loli.net/2023/12/23/CxObVcIyw7EDH2l.png" alt="image-20231218193824106"></p>
<h1 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h1><p>hexo项目结构</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">├── _config.yml #网站的 配置 信息，您可以在此配置大部分的参数</span><br><span class="line">├── package.json #应用程序的信息</span><br><span class="line">├── scaffolds #模版文件夹。当您新建文章时，Hexo 会根据 scaffold 来创建文件</span><br><span class="line">├── source #资源文件夹</span><br><span class="line">|   ├── _drafts #草稿</span><br><span class="line">|   └── _posts #文章</span><br><span class="line">└── themes #主题 文件夹</span><br></pre></td></tr></table></figure>

<h2 id="config-yml配置"><a href="#config-yml配置" class="headerlink" title="config.yml配置"></a>config.yml配置</h2><h3 id="网站相关"><a href="#网站相关" class="headerlink" title="网站相关"></a>网站相关</h3><table>
<thead>
<tr>
<th>字段</th>
<th>注解</th>
<th>实例</th>
</tr>
</thead>
<tbody><tr>
<td><strong>title</strong></td>
<td>网站标题</td>
<td>title: ‘小李的博客’</td>
</tr>
<tr>
<td><strong>subtitle</strong></td>
<td>网站副标题</td>
<td>subtitle: ‘涛之博客’</td>
</tr>
<tr>
<td><strong>description</strong></td>
<td>网站描述</td>
<td>description: ‘记录自己的日常’</td>
</tr>
<tr>
<td><strong>keywords</strong></td>
<td>关键词</td>
<td>keywords: ‘博客’</td>
</tr>
<tr>
<td><strong>author</strong></td>
<td>作者</td>
<td>author: ‘蛇皮小李’</td>
</tr>
<tr>
<td><strong>language</strong></td>
<td>网站使用的语言，常见的有 <code>zh-Hans</code>和 <code>zh-CN</code></td>
<td>language: ‘zh-CN’</td>
</tr>
<tr>
<td><strong>timezone</strong></td>
<td>网站时区。 默认使用您电脑的时区</td>
<td>timezone: ‘Asia&#x2F;Shanghai’</td>
</tr>
</tbody></table>
<p><strong>具体查看官方文档</strong></p>
<h3 id="主题相关"><a href="#主题相关" class="headerlink" title="主题相关"></a>主题相关</h3><ul>
<li><p>选择主题：<a target="_blank" rel="noopener" href="https://hexo.io/themes/">官网</a>或者github上的第三方主题</p>
</li>
<li><p>下载主题：推荐<a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/21cfbf15/">Butterfly</a>和<a target="_blank" rel="noopener" href="https://gitee.com/nate-lin/yilia-plus/">yilia</a></p>
</li>
<li><p>更换主题：</p>
<p>下载主题项目文件到themes目录下</p>
<p>在Hexo根目录的配置文件下配置themes属性</p>
</li>
<li><p>配置主题：具体差查看官方文档</p>
</li>
</ul>
<h1 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h1><ul>
<li><p>确保ssh配置完成</p>
</li>
<li><p>本地项目调试完成</p>
</li>
</ul>
<h2 id="Gitee"><a href="#Gitee" class="headerlink" title="Gitee"></a>Gitee</h2><h3 id="快速部署"><a href="#快速部署" class="headerlink" title="快速部署"></a>快速部署</h3><ol>
<li><p>在gitee新建一个远程仓库用来部署博客项目</p>
</li>
<li><p>配置Hexo项目根目录下的_config.yml文件中的deploy属性</p>
<p><img src="https://s2.loli.net/2023/12/23/W6Zr3Tcxs1D4ebk.png" alt="image-20231219125102259"></p>
</li>
<li><p>配置Hexo项目根目录下的_config.yml文件中的URL属性属性</p>
<p><img src="https://s2.loli.net/2023/12/23/NjUulr3XGB1xaHW.png" alt="image-20231219190900298"></p>
<p><img src="https://s2.loli.net/2023/12/23/TtAnjR1MEr72XcB.png" alt="image-20231219190936421"></p>
</li>
<li><p>在Hexo项目根目录下安装hexo-deployer-git快速部署模块</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2023/12/23/KdeZsx1tLfBpDzq.png" alt="image-20231219125839422"></p>
<p>检查模块是否安装完成</p>
<p><img src="https://s2.loli.net/2023/12/23/RrjlDFkNhJz9iP8.png" alt="image-20231219130106282"></p>
</li>
<li><p>使用快速部署模块</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo g <span class="comment">#将项目转化为静态资源</span></span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo d <span class="comment">#上传到配置好的gitee仓库</span></span></span><br><span class="line">或者</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo g -d <span class="comment">#同时进行</span></span></span><br></pre></td></tr></table></figure>


</li>
<li><p>打开码云仓库点击服务，然后选择Gitee Pages，需要实名才能使用</p>
<p><img src="https://s2.loli.net/2023/12/23/i36PEW42YcpkgZf.png" alt="image-20231219133348008"></p>
</li>
<li><p>部署静态页面</p>
<p><img src="https://s2.loli.net/2023/12/23/VLKsIFgmxauYbJe.png" alt="image-20231219192427344"></p>
<ol start="8">
<li>访问生成的网址</li>
</ol>
<h3 id="源码部署"><a href="#源码部署" class="headerlink" title="源码部署"></a>源码部署</h3><ol>
<li><p>新建gitee仓库</p>
</li>
<li><p>将本地项目pull到远程仓库中</p>
<ul>
<li><p>使用<strong>hexo g</strong> 将源文件装换成静态资源public</p>
</li>
<li><p>修改.gitignore文件，删除public项</p>
</li>
<li><p>修改配置文件：按照快速部署的方式修改配置文件</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git remote add 别名 远程仓库地址</span><br><span class="line">git add . #追踪所有文件</span><br><span class="line">git commit -m &#x27;部署博客&#x27; #提交本地库</span><br><span class="line">git push 别名 分支 #gitee默认分支是master</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li><p>使用Gitee Page部署&#x2F;public文件夹</p>
</li>
</ol>
<p><img src="https://s2.loli.net/2023/12/23/wiKk6f4sNeSYOU2.png" alt="1702964131647"></p>
<ul>
<li><p>选择自己想要部署的分支，默认直接master分支就行</p>
</li>
<li><p><strong>&#x2F;public</strong>目录就是静态资源目录，包含所有的前端资源，只需要将这个目录提供给外部访问就行</p>
</li>
<li><p>然后点击生成的域名，就直接映射到静态网页了</p>
</li>
</ul>
<p>注意</p>
<p><strong>css没有效果</strong>：</p>
<p>如果采用这种方式部署后，网页没有css，这说明项目路由没对，配置博客配置文件</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">url:</span> <span class="string">仓库URL</span></span><br></pre></td></tr></table></figure>

<h4 id="以后部署博客"><a href="#以后部署博客" class="headerlink" title="以后部署博客"></a>以后部署博客</h4><ol>
<li>直接用git bash打开博客目录，</li>
<li>先hexo clean删除public静态文件以及缓存</li>
<li>然后使用hexo g生成public</li>
<li>使用git add .</li>
<li>使用git commit -m 说明（必须要有说明才能使用git push）</li>
<li>使用git push</li>
<li>打开码云 找到博客仓库，找到服务 pages 然后直接点击更新，等待1分钟就部署成功</li>
<li>如果更换了电脑，直接git clone仓库源码就可以了。也可以直接下载仓库zip</li>
</ol>
</li>
</ol>
<h2 id="GitHub"><a href="#GitHub" class="headerlink" title="GitHub"></a>GitHub</h2><h3 id="快速部署-1"><a href="#快速部署-1" class="headerlink" title="快速部署"></a>快速部署</h3><ol>
<li><p>新建仓库</p>
<p><img src="https://s2.loli.net/2023/12/23/8BltiKL1XWcjqGd.png" alt="image-20231219195106478"></p>
</li>
<li><p>配置_config.yml文件下的deploy和URL</p>
<p><img src="https://s2.loli.net/2023/12/23/rZvhEM5UOijSHeI.png" alt="image-20231219194630261"></p>
<p><img src="https://s2.loli.net/2023/12/23/Nu9dynmC2xMYXbo.png" alt="image-20231219194711976"></p>
<p><img src="https://s2.loli.net/2023/12/23/Ci9LqgRxY4SwncP.png" alt="image-20231219201356228"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">URL配置必须按照https://github名称.github.io.git</span><br></pre></td></tr></table></figure>
</li>
<li><p>在Hexo项目根目录下安装hexo-deployer-git快速部署模块</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2023/12/23/KdeZsx1tLfBpDzq.png" alt="image-20231219125839422"></p>
<p>检查模块是否安装完成</p>
<p><img src="https://s2.loli.net/2023/12/23/RrjlDFkNhJz9iP8.png" alt="image-20231219130106282"></p>
</li>
<li><p>使用快速部署模块</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo g <span class="comment">#将项目转化为静态资源</span></span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo d <span class="comment">#上传到配置好的gitee仓库</span></span></span><br><span class="line">或者</span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">hexo g -d <span class="comment">#同时进行</span></span></span><br></pre></td></tr></table></figure>
</li>
<li><p>使用GitHub Pages部署静态页面</p>
<p><img src="https://s2.loli.net/2023/12/23/l7eWczkvuEoHfYp.png" alt="image-20231219201607301"></p>
</li>
</ol>
<p>部署到GitHub的时候，我们的URL不需要有项目的名字在属性中</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://github名称.github.io.git #https://LT-codehub.github.io.git</span><br></pre></td></tr></table></figure>

<p>如果是部署到giteel的时候，我们需要在URL中配置项目名字（仓库名字）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">仓库URL #https://gitee.com/lt-code/hexo</span><br></pre></td></tr></table></figure>

<h4 id="域名访问配置"><a href="#域名访问配置" class="headerlink" title="域名访问配置"></a>域名访问配置</h4><p>如果你拥有自己的域名可以将，项目的访问地址绑定到你自己的域名上，就可以通过域名访问了</p>
<h5 id="配置gitHubPages"><a href="#配置gitHubPages" class="headerlink" title="配置gitHubPages"></a>配置gitHubPages</h5><p><img src="https://s2.loli.net/2023/12/20/xNd2OwimBl85RVa.png" alt="image-20231220202325095"></p>
<h5 id="同步修改配置文件"><a href="#同步修改配置文件" class="headerlink" title="同步修改配置文件"></a>同步修改配置文件</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">url: 自己配置的域名</span><br></pre></td></tr></table></figure>

<h2 id=""><a href="#" class="headerlink" title=""></a></h2><h2 id="个人服务器部署"><a href="#个人服务器部署" class="headerlink" title="个人服务器部署"></a>个人服务器部署</h2><ul>
<li>拥有个人服务器</li>
<li>本地部署Hexo成功</li>
</ul>
<h3 id="安装Git"><a href="#安装Git" class="headerlink" title="安装Git"></a>安装Git</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git --vesion #查看git版本</span><br><span class="line">yum install git #安装git</span><br></pre></td></tr></table></figure>

<h3 id="新建独立用户-可忽略"><a href="#新建独立用户-可忽略" class="headerlink" title="新建独立用户(可忽略)"></a>新建独立用户(可忽略)</h3><p>创建一个用户单独用来管理博客，直接使用root用户也行</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">useradd 用户名 # 添加一个新用户，用户创建成功后在home目录下会有一个用户文件夹</span><br></pre></td></tr></table></figure>

<p>配置用户权限</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">vim /etc/sudoers #打开配置文件修改用户权限</span><br><span class="line">找到这个位置添加下面这句话</span><br><span class="line">用户名        ALL=(ALL)     ALL</span><br><span class="line"></span><br><span class="line">i   #切换到输入模式，在光标当前位置开始输入文本</span><br><span class="line">:w  #保存文件。</span><br><span class="line">:q  #退出 Vim 编辑器。</span><br><span class="line">:q! #强制退出Vim 编辑器，不保存修改。</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">编辑之后</span></span><br><span class="line">ESC+:wq!</span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2023/12/20/pRzX8Cq5MDu14nZ.png" alt="image-20231220230759941"></p>
<p>设置用户的密码</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">passwd 用户名</span><br><span class="line">su 用户名 # 切换用户进行后续操作</span><br><span class="line">cd /home/用户名/ #进入用户文件夹</span><br></pre></td></tr></table></figure>

<h3 id="创建远程仓库"><a href="#创建远程仓库" class="headerlink" title="创建远程仓库"></a>创建远程仓库</h3><p>在服务器创建一个远程远程仓库</p>
<p>创建私有 Git 仓库</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">mkdir -p projects/blog # 把项目目录建立起来</span><br><span class="line">mkdir repos #创建repos目录</span><br><span class="line">cd repos #进入repos目录</span><br><span class="line">git init --bare blog.git # 创建仓库</span><br><span class="line">cd blog.git/hooks</span><br><span class="line">vim post-receive # 创建一个钩子</span><br></pre></td></tr></table></figure>

<p><code>post-receive</code>文件的内容如下：</p>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#!/bin/<span class="keyword">sh</span></span><br><span class="line">git --work-tree=/home/blog/projects/blog --git-dir=/home/blog/repos/blog.git checkout -<span class="keyword">f</span></span><br></pre></td></tr></table></figure>

<p>之后退出vim，继续进行用户相关的操作：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">chmod +x post-receive # 为新建用户添加可执行权限</span><br><span class="line">exit # 返回到root用户</span><br><span class="line">chown -R blog:blog /home/blog/repos/blog.git # 给用户添加权限</span><br></pre></td></tr></table></figure>

<p>这样Git仓库就配好了。在本地试一下能不能把空仓库拉下来：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone 用户名@server_ip:/home/blog/repos/blog.git</span><br></pre></td></tr></table></figure>

<p>如果能拉下来，就说明配置成功了。</p>
<h3 id="配置SSH"><a href="#配置SSH" class="headerlink" title="配置SSH"></a>配置SSH</h3><p><code>Git Bash Here</code></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ssh-copy-id -i ~/.ssh/id_rsa.pub 用户名@server_ip # 建立信任关系</span><br><span class="line">ssh 用户名@server_ip # 试一下能不能登录</span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2023/12/21/fGHEj6w3BKTxJ1L.png" alt="image-20231221000609128"></p>
<h4 id="安全设置"><a href="#安全设置" class="headerlink" title="安全设置"></a>安全设置</h4><p>为了安全起见，这个部署用的git用户最好只能用git clone等操作，所以需要更改它默认的shell：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">su 用户 #切换blog用户</span><br><span class="line">cat /etc/shells # 查看 git-shell 是否在登录方式里面</span><br><span class="line">which git-shell # 找到git-shell的路径，记下来</span><br><span class="line">vim /etc/shells</span><br></pre></td></tr></table></figure>

<p>然后把刚才记下来的路径添加进去，保存，然后<code>vim /etc/passwd</code>，</p>
<p>把<code>git:x:1000:1000::/home/git:/bin/bash</code>修改为<code>git:x:1000:1000:,,,:/home/git:/usr/bin/git-shell</code>。</p>
<p><strong>只需要修改后面的路径<code>bin/bash</code>–&gt;<code>usr/bin/git-shell</code></strong></p>
<p>这样本地ssh应该就没法登录了，只能进行git操作。</p>
<h3 id="部署Hexo"><a href="#部署Hexo" class="headerlink" title="部署Hexo"></a>部署Hexo</h3><p>使用hexo部署工具快速部署</p>
<ul>
<li><p>方法一：在cmd或者git中执行</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo cl</span><br><span class="line">hexo g -d</span><br></pre></td></tr></table></figure>

<p>方法二：修改package.json文件并使用npm命令</p>
</li>
<li><pre><code class="shell">npm run deploy
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">![image-20231221005212710](https://s2.loli.net/2023/12/21/QlAZSuF9tWYCgnJ.png)</span><br><span class="line"></span><br><span class="line">### 配置网站访问</span><br><span class="line"></span><br><span class="line">#### 配置Nginx实现访问</span><br><span class="line"></span><br><span class="line">首先需要配置一下域名解析记录，把`你的域名`也绑定到现在的ip上，以便进行下一步操作。</span><br><span class="line"></span><br><span class="line">前面配置完仓库，也把文件部署上去了，我们把Nginx反向代理也来配置一下。</span><br><span class="line"></span><br><span class="line">```sh</span><br><span class="line">cd /etc/nginx</span><br><span class="line">cp nginx.conf nginx_backup.conf # 备份配置文件</span><br><span class="line">vim nginx.conf</span><br></pre></td></tr></table></figure>
</code></pre>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">nginx server部分</span></span><br><span class="line">server &#123;</span><br><span class="line">listen 80;</span><br><span class="line">server_name 项目ip/解析后的域名;</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">    location / &#123;</span><br><span class="line">        root /home/git/projects/blog;</span><br><span class="line">    index index.html index.htm;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">error_page 500 502 503 504 /50x.html;</span><br><span class="line">location &amp;#61; /50x.html &#123;</span><br><span class="line">    root html;</span><br><span class="line">&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="使用宝塔面板实现访问"><a href="#使用宝塔面板实现访问" class="headerlink" title="使用宝塔面板实现访问"></a>使用宝塔面板实现访问</h4><p>(本质也是使用Nginx)</p>
<p><img src="https://s2.loli.net/2023/12/21/uLSdFi1cCBJ9v8z.png" alt="image-20231221010354732"></p>
<p>提交就完成了</p>
<h2 id="域名配置"><a href="#域名配置" class="headerlink" title="域名配置"></a>域名配置</h2><ul>
<li>拥有一个自己的域名</li>
</ul>
<p>流程：</p>
<ol>
<li>进入对应域名服务商处进行DNS配置，将其指向某一个地址或域名</li>
<li>IPC网站备案</li>
<li>将登记好的域名绑定到自己要访问的web项目上</li>
</ol>
<h3 id="阿里云域名解析"><a href="#阿里云域名解析" class="headerlink" title="阿里云域名解析"></a>阿里云域名解析</h3><ol>
<li><p>进入域名控制台，选择域名解析</p>
<p><img src="https://s2.loli.net/2023/12/20/6meMU5yKFNc1rW4.png" alt="image-20231220200350130"></p>
</li>
<li><p>在解析设置按要求里配置</p>
<p><img src="https://s2.loli.net/2023/12/20/k6I2izqo7OASKye.png" alt="image-20231220201200127"></p>
</li>
</ol>
<h2 id="多部署"><a href="#多部署" class="headerlink" title="多部署"></a>多部署</h2><p>hexo支持通过快速部署模块将一个项目同时部署到多个服务器上</p>
<p><img src="https://s2.loli.net/2023/12/28/NQq5igHcUeAkyr6.png" alt="image-20231228202324258"></p>
<p>注：因为gitee和和github在多部署时需要配置不同的URL属性,所以会导致没有样式，所以不推荐同时使用</p>
<h1 id="图床"><a href="#图床" class="headerlink" title="图床"></a>图床</h1><p>图床的本质就是一个在公网上的文件服务器</p>
<h2 id="SM-MS图床"><a href="#SM-MS图床" class="headerlink" title="SM.MS图床"></a><a target="_blank" rel="noopener" href="https://sm.ms/">SM.MS图床</a></h2><p>直接去SM的官网注册一下就好了，直接上链接：<a target="_blank" rel="noopener" href="https://sm.ms/">SM.MS</a></p>
<p>然后在 <code>Dashboard</code> 中找到 <code>API Token</code>，生成 <code>Token</code> 填入<code>Picgo</code>即可。</p>
<h2 id="CSDN图床"><a href="#CSDN图床" class="headerlink" title="CSDN图床"></a><a target="_blank" rel="noopener" href="https://www.csdn.net/">CSDN图床</a></h2><p>CSDN会将用户写文章时上传的图片保存，我们可以通过这种方式来引用CSDN上的图片</p>
<h2 id="路过图床"><a href="#路过图床" class="headerlink" title="路过图床"></a><a target="_blank" rel="noopener" href="https://imgse.com/">路过图床</a></h2><h2 id="聚合图床"><a href="#聚合图床" class="headerlink" title="聚合图床"></a><a target="_blank" rel="noopener" href="https://www.superbed.cn/">聚合图床</a></h2><h2 id="手摸手教你搭建免费图床"><a href="#手摸手教你搭建免费图床" class="headerlink" title="手摸手教你搭建免费图床"></a><a target="_blank" rel="noopener" href="https://segmentfault.com/a/1190000023572965">手摸手教你搭建免费图床</a></h2><h1 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h1><p>使用Pages技术部署其他静态网站</p>
<ol>
<li><p>准备好本地的静态资源网站</p>
</li>
<li><p>上传到gitee&#x2F;github远程仓库</p>
<p>可以使不同的仓库，也可以是同一仓库的不同分支，<strong>建议使用不同分支</strong></p>
</li>
<li><p>使用pages配置</p>
<ul>
<li><p>在gitee中：</p>
<p><img src="https://s2.loli.net/2023/12/20/8OT9peiKNqRGyId.png" alt="image-20231220143432933"></p>
<p><strong>通过切换不同的分支则可以切换不同的网站</strong></p>
</li>
<li><p>在github中：</p>
<p><img src="https://s2.loli.net/2023/12/20/rZy3K4D7mqXGYNE.png" alt="image-20231220143656552"></p>
</li>
</ul>
</li>
</ol>
<p><strong>通过切换不同的分支则可以切换不同的网站</strong></p>
<h1 id="引用"><a href="#引用" class="headerlink" title="引用"></a>引用</h1><p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">Hexo官方文档</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.yxqz.top/">余小小的博客</a></p>
<p><a target="_blank" rel="noopener" href="https://developer.aliyun.com/article/775005?spm=a2c6h.14164896.0.0.8c4747c5Af8xGw&scm=20140722.S_community@@%E6%96%87%E7%AB%A0@@775005._.ID_775005-RL_%E8%AE%B0%E5%BD%95hexo%E9%83%A8%E7%BD%B2-LOC_search~UND~community~UND~item-OR_ser-V_3-P0_0">记录Hexo部署到阿里云服务器全过程</a></p>
<p><a target="_blank" rel="noopener" href="https://developer.aliyun.com/article/787380?spm=a2c6h.14164896.0.0.8c4747c5Af8xGw&scm=20140722.S_community@@%E6%96%87%E7%AB%A0@@787380._.ID_787380-RL_hexo%E5%8D%9A%E5%AE%A2%E9%83%A8%E7%BD%B2%E5%9C%A8%E9%98%BF%E9%87%8C%E4%BA%91%E4%B8%8A-LOC_search~UND~community~UND~item-OR_ser-V_3-P0_0">Hexo博客部署在阿里云上</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://LT-codehub.github.io.git">蛇皮小李</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://lt-codehub.github.io.git/2023/12/23/Hexo%E5%BB%BA%E7%AB%99/">https://lt-codehub.github.io.git/2023/12/23/Hexo%E5%BB%BA%E7%AB%99/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://LT-codehub.github.io.git" target="_blank">小李的博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/12/23/%E4%B8%80%E6%96%87%E8%AE%B2%E9%80%8F%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/" title="内网穿透"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">内网穿透</div></div></a></div><div class="next-post pull-right"><a href="/2023/12/20/Node.js%E5%AE%89%E8%A3%85/" title="Nodejs"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Nodejs</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">蛇皮小李</div><div class="author-info__description">记录自己的日常</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%AE%80%E4%BB%8B"><span class="toc-number">1.</span> <span class="toc-text">简介</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85"><span class="toc-number">2.</span> <span class="toc-text">安装</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8"><span class="toc-number">3.</span> <span class="toc-text">使用</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE"><span class="toc-number">4.</span> <span class="toc-text">配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#config-yml%E9%85%8D%E7%BD%AE"><span class="toc-number">4.1.</span> <span class="toc-text">config.yml配置</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E7%9B%B8%E5%85%B3"><span class="toc-number">4.1.1.</span> <span class="toc-text">网站相关</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E7%9B%B8%E5%85%B3"><span class="toc-number">4.1.2.</span> <span class="toc-text">主题相关</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2"><span class="toc-number">5.</span> <span class="toc-text">部署</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Gitee"><span class="toc-number">5.1.</span> <span class="toc-text">Gitee</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2"><span class="toc-number">5.1.1.</span> <span class="toc-text">快速部署</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%BA%90%E7%A0%81%E9%83%A8%E7%BD%B2"><span class="toc-number">5.1.2.</span> <span class="toc-text">源码部署</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BB%A5%E5%90%8E%E9%83%A8%E7%BD%B2%E5%8D%9A%E5%AE%A2"><span class="toc-number">5.1.2.1.</span> <span class="toc-text">以后部署博客</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#GitHub"><span class="toc-number">5.2.</span> <span class="toc-text">GitHub</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2-1"><span class="toc-number">5.2.1.</span> <span class="toc-text">快速部署</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9F%9F%E5%90%8D%E8%AE%BF%E9%97%AE%E9%85%8D%E7%BD%AE"><span class="toc-number">5.2.1.1.</span> <span class="toc-text">域名访问配置</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E9%85%8D%E7%BD%AEgitHubPages"><span class="toc-number">5.2.1.1.1.</span> <span class="toc-text">配置gitHubPages</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%90%8C%E6%AD%A5%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">5.2.1.1.2.</span> <span class="toc-text">同步修改配置文件</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link"><span class="toc-number">5.3.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%AA%E4%BA%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%83%A8%E7%BD%B2"><span class="toc-number">5.4.</span> <span class="toc-text">个人服务器部署</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85Git"><span class="toc-number">5.4.1.</span> <span class="toc-text">安装Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E7%8B%AC%E7%AB%8B%E7%94%A8%E6%88%B7-%E5%8F%AF%E5%BF%BD%E7%95%A5"><span class="toc-number">5.4.2.</span> <span class="toc-text">新建独立用户(可忽略)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93"><span class="toc-number">5.4.3.</span> <span class="toc-text">创建远程仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AESSH"><span class="toc-number">5.4.4.</span> <span class="toc-text">配置SSH</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E5%85%A8%E8%AE%BE%E7%BD%AE"><span class="toc-number">5.4.4.1.</span> <span class="toc-text">安全设置</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2Hexo"><span class="toc-number">5.4.5.</span> <span class="toc-text">部署Hexo</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF%E5%AE%9E%E7%8E%B0%E8%AE%BF%E9%97%AE"><span class="toc-number">5.4.5.1.</span> <span class="toc-text">使用宝塔面板实现访问</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%9F%E5%90%8D%E9%85%8D%E7%BD%AE"><span class="toc-number">5.5.</span> <span class="toc-text">域名配置</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%98%BF%E9%87%8C%E4%BA%91%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90"><span class="toc-number">5.5.1.</span> <span class="toc-text">阿里云域名解析</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E9%83%A8%E7%BD%B2"><span class="toc-number">5.6.</span> <span class="toc-text">多部署</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.</span> <span class="toc-text">图床</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#SM-MS%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.1.</span> <span class="toc-text">SM.MS图床</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CSDN%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.2.</span> <span class="toc-text">CSDN图床</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B7%AF%E8%BF%87%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.3.</span> <span class="toc-text">路过图床</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%81%9A%E5%90%88%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.4.</span> <span class="toc-text">聚合图床</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%89%8B%E6%91%B8%E6%89%8B%E6%95%99%E4%BD%A0%E6%90%AD%E5%BB%BA%E5%85%8D%E8%B4%B9%E5%9B%BE%E5%BA%8A"><span class="toc-number">6.5.</span> <span class="toc-text">手摸手教你搭建免费图床</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%85%B6%E4%BB%96"><span class="toc-number">7.</span> <span class="toc-text">其他</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%BC%95%E7%94%A8"><span class="toc-number">8.</span> <span class="toc-text">引用</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/12/23/%E5%9F%9F%E5%90%8D%E8%8E%B7%E5%8F%96/" title="域名获取">域名获取</a><time datetime="2023-12-23T12:27:08.000Z" title="发表于 2023-12-23 20:27:08">2023-12-23</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/12/23/%E4%B8%80%E6%96%87%E8%AE%B2%E9%80%8F%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/" title="内网穿透">内网穿透</a><time datetime="2023-12-23T12:26:26.000Z" title="发表于 2023-12-23 20:26:26">2023-12-23</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/12/23/Hexo%E5%BB%BA%E7%AB%99/" title="Hexo建站">Hexo建站</a><time datetime="2023-12-23T12:26:08.000Z" title="发表于 2023-12-23 20:26:08">2023-12-23</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/12/20/Node.js%E5%AE%89%E8%A3%85/" title="Nodejs">Nodejs</a><time datetime="2023-12-20T03:37:29.000Z" title="发表于 2023-12-20 11:37:29">2023-12-20</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By 蛇皮小李</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>